package com.example.phoneshop.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping({"index", "/", ""})
public class IndexController {
    @RequestMapping(value = {"index", "/", ""}, method = RequestMethod.GET)
    public ModelAndView index(){
        ModelAndView model = new ModelAndView("index/index");
        model.addObject("title", "首页");
        return model;
    }

    @RequestMapping(value = "test", method = RequestMethod.GET)
    public ModelAndView test(){
        ModelAndView model = new ModelAndView("index/test");
        model.addObject("title", "测试模版");
        return model;
    }
}
